package com.cjm.one.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.result.Result;
import com.cjm.one.goods.client.GoodsCartClient;
import com.cjm.one.model.goods.entity.GoodsCart;
import com.cjm.one.model.goods.vo.GoodsSkuCartVo;
import com.cjm.one.service.GoodsCartService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsCartServiceImpl  implements GoodsCartService {
    @Resource
    private GoodsCartClient goodsCartClient;
    @Override
    public Result<Page<GoodsSkuCartVo>> getCartList(Integer current, Integer size) {
        return goodsCartClient.getCartList(current, size);
        
    }

    @Override
    public Result<Long> addCart(GoodsCart cart) {
        return goodsCartClient.addCart(cart);
        
    }

    @Override
    public Result<Boolean> updateCart(GoodsCart cart) {
        return  goodsCartClient.updateCart(cart);
        
    }

    @Override
    public Result<Boolean> deleteCart(Long id) {
        return  goodsCartClient.deleteCart(id);
        
    }

    @Override
    public Result<Boolean> deleteCartAll() {
        return goodsCartClient.deleteCartAll();
        
    }

    @Override
    public Result<Boolean> deleteCartBatch(Long[] ids) {
       return goodsCartClient.deleteCartBatch(ids);
        
    }

    @Override
    public Result<List<GoodsCart>> getAllCartList() {
        return goodsCartClient.getAllCartList();
    }

    @Override
    public Result<Page<GoodsSkuCartVo>> getCartListByIds(Long[] ids) {
        return  goodsCartClient.getCart(ids);
    }
}
